<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: {2021/5/22}
 * Time: {20:37}
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

namespace app\common\model\mysql;


use app\common\lib\Status;

class AdminUser extends BaseModel
{
    protected $autoWriteTimestamp = true;

    /**
     * 根据用户名获取用户信息
     * 状态为正常的数据
     * @param string $useradmin
     * @param string $field
     * @return array|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getAdminUserByUserAdmin(string $username = '', string $field = '*')
    {
        return $this->field($field)->where('username', $username)
            ->where('status', Status::Mysql_success)
            ->find();
    }
}